package com.mew.common.enm;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;


public enum TouchType {
    None(0, "正常"),
    Ceiling(1, "天花板"),
    PayMaxTimes(2, "最大次数")
    ;

    private final static Map<Integer, TouchType> stateMap
            = Arrays.stream(TouchType.values()).collect(Collectors.toMap(TouchType::code, code -> code));

    private final int code;
    private final String desc;


    TouchType(final int code, final String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int code() {
        return this.code;
    }


    public static TouchType parse(int code) {
        return stateMap.get(code);
    }


}
